home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*_________________________________________________________________________
- |
- | mymath.h - define some additional constants and macros
- |
- | defines a few variables with float precision, and adds macros
- | that work with degrees instead of radians; MIN, MAX and SQR can be
- | found here too.
- |
- | (c) Frans van Hoesel, Xtreme Graphics Software, hoesel@chem.rug.nl
- */
-
- #ifndef MYMATH_H__SEEN
- #include <math.h>
-
- #define PI2 6.28318530717958647692
- #define PI2_f 6.28318530717958647692F
- #define PI 3.14159265358979323846
- #define PI_f 3.14159265358979323846F
- #define BY_PI 0.31830988618379067153
- #define BY_PI_f 0.31830988618379067153F
- #define GOLDEN 1.616803398874989484820
- #define GOLDEN_f 1.616803398874989484820F
- #define DEG_TO_RAD 0.01753292519943295769236907
- #define DEG_TO_RAD_f 0.01753292519943295769236907F
- #define RAD_TO_DEG 57.29577951308232087684636
- #define RAD_TO_DEG_f 57.29577951308232087684636F
- #define COS(x) cos((x) * DEG_TO_RAD)
- #define COS_f(x) cosf((x) * DEG_TO_RAD_F)
- #define SIN(x) sin((x) * DEG_TO_RAD)
- #define SIN_f(x) sinf((x) * DEG_TO_RAD_F)
- #define TAN(x) tan((x) * DEG_TO_RAD)
- #define TAN_f(x) tanf((x) * DEG_TO_RAD_F)
- #define MIN(x,y) ((x)<(y)?(x),(y))
- #define MAX(x,y) ((x)>(y)?(x),(y))
- #define SQR(x) ((x)*(x))
- #define ABS(x) (((x) < 0) ? -(x) : (x))
-
-
- #define MYMATH_H__SEEN
- #endif
-